<?php
require_once 'models/TMSACL.inc';
require_once 'pages/TMSItemPage.inc';
require_once 'widgets/TSkinnableWidget.inc';

class TPwdSetWidget extends TSkinnableWidget {
	protected function checkSource($src){
		return $src instanceof TMSACL;
	}	
	
	public function http_SetPassword($pwd){
		$this->Source->SetPassword($this->response->ModelItem->ItemId(),$pwd);
	}
	
	public function defaultOutput(IThemeEngine $engine){
		?>
		<form id="<?php echo $this->Name(); ?>" class="pwd-gen" method="post">
			<input type="hidden" name="controller" value="<?php echo $this->Name(); ?>" />
			<input type="hidden" name="method" value="SetPassword" />
			<input type="password" name="pwd" />
			<button onclick="javascript:submit();"><?php __i('Edit'); ?></button>
		</form>
		<?php
	}
}